package com.wangsh.usersCenter.system.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.usersCenter.common.pojo.BasePojo;

public class ASysIp extends BasePojo<ASysIp>
{
	private int id;
	private int regionId;
	private String name;
	private String ip;
	private String ipStr;
	private String isp;
	private String response;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	
	/*--字符串表示--*/
	private String statusStr ; 
	/*--对象表示--*/
	private ARegion region ; 
	
	/* 存储所有状态的容器 */
	private Map<String,String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		ASysIpEnum[] sysIpEnums = ASysIpEnum.values();
		for (int i = 0; i < sysIpEnums.length; i++)
		{
			ASysIpEnum sysIpEnum = sysIpEnums[i];
			String key = sysIpEnum.toString() ; 
			enumsMap.put(key + "-" + sysIpEnum.getStatus() + "", sysIpEnum.getName());
		}
		return enumsMap;
	}
	
	public String getStatusStr()
	{
		// 根据状态值获取字符串描述
		ASysIpEnum[] sysIpEnums = ASysIpEnum.values();
		for (int i = 0; i < sysIpEnums.length; i++)
		{
			ASysIpEnum sysIpEnum = sysIpEnums[i];
			if (sysIpEnum.toString().startsWith("STATUS_"))
			{
				// 表示是状态的标识
				if (sysIpEnum.getStatus() == this.getStatus())
				{
					this.statusStr = sysIpEnum.getName();
					break;
				}
			}
		}
		return statusStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getRegionId()
	{
		return regionId;
	}

	public void setRegionId(int regionId)
	{
		this.regionId = regionId;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getIp()
	{
		return ip;
	}

	public void setIp(String ip)
	{
		this.ip = ip;
	}

	public String getIpStr()
	{
		return ipStr;
	}

	public void setIpStr(String ipStr)
	{
		this.ipStr = ipStr;
	}

	public String getIsp()
	{
		return isp;
	}

	public void setIsp(String isp)
	{
		this.isp = isp;
	}

	public String getResponse()
	{
		return response;
	}

	public void setResponse(String response)
	{
		this.response = response;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public ARegion getRegion()
	{
		return region;
	}

	public void setRegion(ARegion region)
	{
		this.region = region;
	}
}
